//路径
var Path = {
    lineWidth:6,//线的宽度
    arrowLen:20,//箭头耳朵长度,
    goColor:'blue',
    svColor:'red',
    createNew: function(id, startPort, endPort, type_go_sv){
        var path = {};
        path.id = id;
        path.startPort = startPort;
        path.endPort = endPort;
        path.type = type_go_sv;
        path.draw = function(canvas){
            Path.draw(this, canvas);
        };
        return path;
    },
    draw: function(obj,canvas){
        var startPos = obj.startPort.getOutConnectorPos();
        var endPos = obj.endPort.getInConnectorPos();
        var len = Math.sqrt( (startPos.x - endPos.x) * (startPos.x - endPos.x) + (startPos.y - endPos.y) * (startPos.y - endPos.y) );
        var arrowColor = Path.goColor;
        if(obj.type == 'SV' || obj.type == 'sv'){
            arrowColor = Path.svColor;
        } 
        //画箭头
        drawArrow(canvas, startPos.x , startPos.y, endPos.x, endPos.y, 30, Path.arrowLen, Path.lineWidth, arrowColor, obj.isDash);
    }
}